<%-- 
    Document   : updateTest
    Created on : Nov 4, 2009, 4:11:16 PM
    Author     : khanhlv_b00554
--%>

<%@page contentType="text/html" pageEncoding="UTF-8" import="java.sql.*,DAO.*"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%
            int id = Integer.parseInt(request.getParameter("id"));
            String txtSubSubject = request.getParameter("txtSubSubject");
            Test check = new Test();
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" media="screen" href="css/admin.css">
        <title>JSP Page</title>
    </head>
    <script language="javascript" src="js/checkForm.js" ></script>
    <body>
        <form name="myForm" method="post" action="actionUpdate.jsp?id=<%=id%>&txtSubSubject=<%=txtSubSubject%>">
            <fieldset class="lang" >
                <table align="center" width="500">
                    <br>
                    <tr>
                        <td></td>
                        <td align="center">
                            <span class="textSpanTitle"> Update Test Question </span>
                        </td>
                    </tr>
                    <tr>
                        <td>Content Test :</td>
                        <td>
                            <%
                               ResultSet rsTestName = check.viewTestCheck(id);
                               if (rsTestName.next()) {
                            %>
                            <p>
                            <label>
                            <textarea cols="50" rows="8"  name="txtContentTest"><%=rsTestName.getString("TestName")%></textarea>
                            </label>
                            <span id="txtContent" class="textSpanCheck"></span>
                            </p>
                            <% } %>
                        </td>
                    </tr>
                    <tr>
                        <td>Time : </td>
                        <td>
                            <%
                               ResultSet rsTime = check.viewTestCheck(id);
                               if (rsTime.next()) {
                            %>
                            <select name="txtTime">
                                <%
                                    for(int i=15;i<=90;i= i+5) {
                                %>
                                <option value="<%=i%>" <% if (rsTime.getInt("TestTime") == i) { %> selected="true" <% } %>><%=i%></option>
                                <% } %>
                            </select>
                            <% } %>
                            <span class="textSpan">Phút</span>
                        </td>
                    </tr>
                    <tr>
                        <td>Status : </td>
                        <td>
                            <%
                                        ResultSet rs = check.viewTestCheck(id);
                                        if (rs.next()) {
                            %>
                            <input type="radio" name="txtStatus" value="True" <% if (rs.getBoolean("Status") == true) {%> checked="true" <% }%> > <span class="textSpan">Hiển Thị</span>
                            <input type="radio" name="txtStatus" value="False" <% if (rs.getBoolean("Status") == false) {%> checked="true" <% }%> > <span class="textSpan">Không Hiển Thị</span>
                            <% }%>
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <input type="button" value="Update Test" class="button"  onclick="checkForm()"/>
                            <input type="reset" value="Reset" class="button" />
                        </td>
                    </tr>
                </table>
            </fieldset>
        </form>
    </body>
</html>
